
#include "rtthread.h"
#include "rthw.h"
#include "board.h"
#include "init.h"

int main(void)
{
    /* cpu clock initialization */
    cpu_init();

    /* disable interrupt */
    rt_hw_interrupt_disable();

    /* board level initialization
      * NOTE:   please initialize heap && systick 
      *         inside board initialization.
      */
    rt_hw_board_init();

    /* timer system initialization */
    rt_system_timer_init();

    /* scheduler system initialization */
    rt_system_scheduler_init();

    /* create init_thread */
    rt_application_init();

    /* timer thread initialization */
    rt_system_timer_thread_init();

    /* idle thread initialization */
    rt_thread_idle_init();

    /* start scheduler */
    rt_system_scheduler_start();

    return 0;
}
